package week3;
import java.util.Scanner;
/**
 * Created by dell on 2017/3/13.
 */
public class Homework21 {
    public static void main(String[] args){
        int n,fn;
        Scanner scanner = new Scanner(System.in);
        System.out.print("求几个费式数？");
        n = scanner.nextInt();
        fn = Fib(n);
        for(int i = 0;i <= n;i++){
            System.out.printf("%4d",Fib(i));
        }
    }
    public static int Fib(int n){
        if(n == 0 || n ==1){
            return 1;
        }
        else {
            return Fib(n-1)+Fib(n-2);
        }
    }
}
